package models

import (
	"go-admin/common/models"
	"time"
)

type SysAlarm struct {
	models.Model
	ChannelId        string    `json:"channelId" gorm:"type:varchar(50);comment:通道ID"`
	DeviceId         string    `json:"deviceId" gorm:"type:varchar(50);comment:设备ID"`
	AlarmTime        time.Time `json:"alarmTime" gorm:"type:datetime;comment:报警时间"`
	AlarmPriority    int       `json:"alarmPriority" gorm:"type:int;comment:属性"`
	AlarmMethod      int       `json:"alarmMethod" gorm:"type:int;comment:方式"`
	AlarmDescription string    `json:"alarmDescription" gorm:"type:varchar(255);comment:描述"`
	AlarmType        int       `json:"alarmType" gorm:"type:int;comment:类型"`
	AlarmTypeParam   string    `json:"alarmTypeParam" gorm:"type:varchar(255);comment:类型参数"`
	Longitude        float64   `json:"longitude" gorm:"type:double;comment:经度"`
	Latitude         float64   `json:"latitude" gorm:"type:double;comment:纬度"`
	models.ModelTime
	models.ControlBy
}

func (SysAlarm) TableName() string {
	return "sys_alarm"
}

func (e *SysAlarm) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *SysAlarm) GetId() interface{} {
	return e.Id
}
